package com.treasure.mall.biz.vo.product;

import com.treasure.mall.biz.entity.product.ProductPO;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * @author wm
 */
@Data
@NoArgsConstructor
public class ProductApiVo {
    /**
     * 产品id
     */
    private Long productId;

    /**
     * 商家Id
     */
    private Long merchantId;
    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品类型
     */
    private Integer productType;

    /**
     * 类目id
     */
    private Integer catId;

    /**
     * 尺寸
     */
    private String propSize;

    /**
     * 材质
     */
    private String propMaterial;

    /**
     * 产地
     */
    private String location;

    /**
     * 重量单位
     */
    private String weightUnit;

    /**
     * weight
     */
    private BigDecimal weight;

    /**
     * 价格
     */
    private BigDecimal price;

    /**
     * 市场价
     */
    private BigDecimal mktPrice;

    /**
     * 服务标签
     */
    private String serviceTags;

    /**
     * 限购数
     */
    private Integer limitedNum;

    /**
     * 主图
     */
    private String mainPic;


    /**
     * 视频
     */
    private String video;

    /**
     * 库存
     */
    private Integer store;
    /**
     * 商品标签
     */
    private String productTags;


    private BigDecimal commissionRate;

    private Long roomId;
    /**
     * 店铺名称
     */
    private String shopName;
    private Integer recommendFlag = 0;

    public ProductApiVo(ProductPO productPO) {
        this.productId = productPO.getProductId();
        this.productName = productPO.getProductName();
        this.merchantId = productPO.getMerchantPO().getId();
        this.location = productPO.getLocation();
        this.shopName = productPO.getMerchantPO().getData().getTitle();
        this.price = productPO.getPrice();
        this.mktPrice = productPO.getMktPrice();
        this.mainPic = productPO.getMainPic();
        this.serviceTags = productPO.getServiceTags();
        this.productTags = productPO.getProductTags();
        this.store = productPO.availableStore();
    }
}